package com.gpj.sqlbuilder.store.excel;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

/**
 * @className RowInfo
 * @description TODO
 * @author GPJ
 * @date 2020/3/18 17:05
 * @version 1.0
 **/
@Setter
@Getter
@AllArgsConstructor
public class CellInfo {
    private static final String NOTE_MARK = "--";
    private static final String ROW_END_MARK = ">>>";
    private static final String CELL_END_MARK = "<<";

    private String sheetName;
    private int rowNum;
    private String value;
    private int index;

    public boolean isNote() {
        return StringUtils.equals(NOTE_MARK, value);
    }

    public boolean isMark() {
        return StringUtils.equals(ROW_END_MARK, value);
    }

    public boolean isValid() {
        return !isNote() && !isMark() && !isEnd();
    }

    public boolean isEnd(){
        return StringUtils.equals(CELL_END_MARK, value);
    }
}
